package creationalPatterns.factory;


interface TV {
    void play();
}
interface AC {
    void cool();
}
class HaierTV implements TV {
    public void play() {
        System.out.println("HaierTV");
    }
}
class HaierAC implements AC {
    public void cool() {
        System.out.println("HaierAC");
    }
}
class GeTV implements TV {
    public void play() {
        System.out.println("GeTV");
    }
}
class GeAC implements AC {
    public void cool() {
        System.out.println("GeAC");
    }
}
interface Factory {
    TV createTV();
    AC createAC();
}
class HaierFactory implements Factory {
    @Override
    public TV createTV() {
        return new HaierTV();
    }
    @Override
    public AC createAC() {
        return new HaierAC();
    }
}
class GeFactory implements Factory {
    @Override
    public TV createTV() {
        return new GeTV();
    }
    @Override
    public AC createAC() {
        return new GeAC();
    }
}
public class AbstractFactoryPattern {
    public static void main(String[] args){
        Factory factory = new HaierFactory();
        TV tv = factory.createTV();
        AC ac = factory.createAC();
        tv.play();
        ac.cool();
    }
}
